de.ueberdosis.mp3info.id3v2
Class FileFrameDataSource

java.lang.Object
  |
  +--de.ueberdosis.mp3info.id3v2.FileFrameDataSource
All Implemented Interfaces:
DataSource, Defines

public class FileFrameDataSource
extends java.lang.Object
implements DataSource


Field Summary
 
Fields inherited from interface de.ueberdosis.mp3info.Defines
DEFAULT_ENCODING, ID3V2_FOOTER_SIZE, ID3V2_FRAME_HEADER_SIZE, ID3V2_HEADER_SIZE, ID3V2_X_HEADER_SIZE, MP3_FRAME_HEADER_SIZE, SUPPORTED_NUMBER_OF_EXTENDED_FLAG_BYTES, testPositions, VERSION
 
Constructor Summary
FileFrameDataSource(de.ueberdosis.mp3info.id3v2.ID3V2Frame frm, java.io.RandomAccessFile in)
          Creates a DataSource that reads from a file.
 
Method Summary
 byte getByte()
          delivers the next available byte
 byte[] getBytes(long number)
          delivers the next available bytes
 long getBytesLeft()
          informs how many more bytes can be read
 byte[] getBytesTo(byte stopByte)
          delivers the next bytes until a 0 or the end is encountered
 boolean hasMoreBytes()
          informs whether there are more bytes than can be read
 void reset()
          Sets the internal pointer to the start of the data
 void seek(long position)
          Sets the internal pointer to a given position in the data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFrameDataSource

public FileFrameDataSource(de.ueberdosis.mp3info.id3v2.ID3V2Frame frm,
                           java.io.RandomAccessFile in)
Creates a DataSource that reads from a file.

Parameters:
frm - contains the basic information
in - the file to read from
Method Detail

getByte

public byte getByte()
             throws SeekPastEndException
delivers the next available byte

Specified by:
getByte in interface DataSource
Returns:
next byte
SeekPastEndException

getBytes

public byte[] getBytes(long number)
                throws SeekPastEndException
delivers the next available bytes

Specified by:
getBytes in interface DataSource
Parameters:
number - number of bytes to deliver
Returns:
demanded bytes
SeekPastEndException

getBytesTo

public byte[] getBytesTo(byte stopByte)
delivers the next bytes until a 0 or the end is encountered

Specified by:
getBytesTo in interface DataSource
Parameters:
stopByte - at what byte to stop
Returns:
demanded bytes

reset

public void reset()
Sets the internal pointer to the start of the data

Specified by:
reset in interface DataSource

hasMoreBytes

public boolean hasMoreBytes()
informs whether there are more bytes than can be read

Specified by:
hasMoreBytes in interface DataSource
Returns:
true if there are bytes to follow

getBytesLeft

public long getBytesLeft()
informs how many more bytes can be read

Specified by:
getBytesLeft in interface DataSource
Returns:
number of bytes to be read

seek

public void seek(long position)
          throws SeekPastEndException
Sets the internal pointer to a given position in the data

Specified by:
seek in interface DataSource
Parameters:
position - position to set the internal pointer to
SeekPastEndException